<template>
	<picker v-if="!readonly" mode="time" :value="_value" @change="timeChange">
		<click-input :value="_value" :placeholder="$t(props.formProps.placeholder) || $t('webAuto.PleaseSelectTime')" pre-icon="calendar"></click-input>
	</picker>
	<view class="w-form-input-rv" v-else>
		<text style="line-height:70rpx">{{_value}}</text>
	</view>
</template>

<script setup>
	import { ref, computed } from 'vue'
	import ClickInput from '@/components/ClickInput.vue'

	const props = defineProps({
		formProps: {
			type: Object,
			default: () => {
				return {}
			}
		},
		modelValue: String,
		readonly: Boolean
	})

	const _value = computed({
		get() {
			return props.modelValue
		},
		set(val) {
			emits('update:modelValue', val)
		}
	})

	const emits = defineEmits(['update:modelValue'])
	
	function timeChange(e) {
		_value.value = e.detail.value
	}
</script>

<style>
</style>